<?php

namespace App\Http\Requests;

use Illuminate\Foundation\Http\FormRequest;

class ServerV2StoreRequest extends FormRequest
{
    /**
     * Determine if the user is authorized to make this request.
     *
     * @return bool
     */
    public function authorize()
    {
        return true;
    }

    /**
     * Get the validation rules that apply to the request.
     *
     * @return array
     */
    public function rules()
    {
        return [
            'name' => 'required|max:10',
            'domain' => 'required|alpha_num|min:3|max:15|unique:server|not_in:www,admin,demo,china,sex,fuck',
//            'server_host' => 'required',
//
//            'root_pwd' => 'required|max:20',

        ];
    }

    public function messages()
    {
        return [
            'name.required'=>'服务器名称必填',
//            'domain.required'=>'域名必填',
            'domain.not_in'=>'关键字不能使用',
//            'server_host.required'=>'服务器地址必填',
//
//            'root_pwd.required'=>'数据库密码必填',

        ];
    }
}
